package com.cma.cmabackend.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.ManyToMany;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
@NoArgsConstructor
@Entity(name = "labEmp")
public class LabEmp extends User {

    final private int type = 1;

    @ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "emps")
    @JsonIgnore
    private List<Parameter> missionList;

    public LabEmp(User user) {
        super(user);
        missionList = new ArrayList<>();
    }
}